Skip to content

feat: emit swap_cancelled event on successful cancel_swap - #97

Merged
fejilaup-cloud merged 2 commits into
AtomicIP:mainfrom
graycioustukura-sketch:feat/cancel-swap-event
Mar 26, 2026
Merged

feat: emit swap_cancelled event on successful cancel_swap#97
fejilaup-cloud merged 2 commits into
AtomicIP:mainfrom
graycioustukura-sketch:feat/cancel-swap-event

Conversation

@graycioustukura-sketch

Copy link
Copy Markdown

Close #18

- Add SwapCancelledEvent contracttype with swap_id and canceller fields
- cancel_swap gains a canceller: Address param and calls env.events().publish
  with topic swp_cncld after the state write — event only fires on success
- Add 4 tests:
  - test_cancel_pending_swap_emits_event: asserts topic and payload fields
  - test_cancel_accepted_swap_emits_event: same for Accepted state
  - test_cancel_completed_swap_fails_no_event: panics before event fires
  - test_no_cancel_event_when_swap_completed_normally: zero events on reveal

Closes AtomicIP#19
@drips-wave

drips-wave Bot commented Mar 25, 2026

Copy link
Copy Markdown

@graycioustukura-sketch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@fejilaup-cloud
fejilaup-cloud merged commit b8d1e0b into AtomicIP:main Mar 26, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: cancel_swap does not emit an event

2 participants